[Linux] AS不能输入中文的解决方法

Posted by Aerber Zhou on 2016-07-21

http://blog.sina.com.cn/s/blog_c92554b40102vynb.html



前提条件是用的是fcitx

1.用gedit或者vi打开studio.sh

2.在很多#的后面加上三行代码

1
2
3
4
5
export XMODIFIERS="@im=fcitx"

export GTK_IM_MODULE="fcitx"

export QT_IM_MODULE="fcitx"

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#
# ---------------------------------------------------------------------
# Android Studio startup script.
# ---------------------------------------------------------------------
#

export XMODIFIERS="@im=fcitx"

export GTK_IM_MODULE="fcitx"

export QT_IM_MODULE="fcitx"

message()
{
TITLE="Cannot start Android Studio"
if [ -n `which zenity` ]; then
zenity --error --title="$TITLE" --text="$1"
elif [ -n `which kdialog` ]; then
kdialog --error --title "$TITLE" "$1"
elif [ -n `which xmessage` ]; then
xmessage -center "ERROR: $TITLE: $1"
elif [ -n `which notify-send` ]; then
notify-send "ERROR: $TITLE: $1"
else
echo "ERROR: $TITLE\n$1"
fi
}

这是前几行代码

3.重启就可以.


同样的,wps不能输入中文也可以这样配置